package com.llkj.common.observer;

import com.llkj.common.exception.ApiException;

import io.reactivex.observers.DisposableObserver;

/**
 * author: zhu.px
 * e-mail: 1271901673@qq.com
 * time  : 2018/4/20
 * desc  :
 */
public abstract class BaseSubscriber<T> extends DisposableObserver<T> {

    BaseSubscriber() {

    }

    @Override
    public void onError(Throwable e) {
        e.printStackTrace();
        onError(ApiException.handleException(e));
    }

    protected abstract void onError(ApiException e);

}
